package com.atrix.CinemaView.pojo.dto.info;

import com.atrix.CinemaView.pojo.Container;
import com.atrix.CinemaView.pojo.FileObj;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.List;
import java.util.stream.Collectors;

@Data
@ApiModel("视频信息")
public class VideoInfo {
    @ApiModelProperty("视频容器名称")
    private String containerName;
    @ApiModelProperty("容器内视频名称列表")
    private List<String> videoNameList;
    
    public VideoInfo(Container<FileObj> container) {
        this.containerName = container.getName();
        this.videoNameList = container.getData()
                .stream().map(FileObj::getName).collect(Collectors.toList());
    }
}
